package com.tea.tl.service.impl;

import com.tea.common.dto.DiscountCouponOrderAddDto;
import com.tea.common.vo.R;
import com.tea.tl.dao.DiscountCouponOrderDao;
import com.tea.tl.domain.DiscountCouponOrder;
import com.tea.tl.service.intf.DiscountCouponOrderService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class DiscountCouponOrderServiceImpl implements DiscountCouponOrderService {
    @Resource
    private DiscountCouponOrderDao dao;
    /**
     * 1.创建订单*/
    @Override
    public R add(DiscountCouponOrderAddDto dto, int uid) {
        if (dto!=null){
            DiscountCouponOrder order = new DiscountCouponOrder();
            BeanUtils.copyProperties(dto,order);
            order.innit();
            order.setUid(uid);
            if (dao.insert(order)>0){
                //发起支付 返回支付二维码

            }
        }
        return null;
    }
    /**
     * 2.更改订单状态*/
    @Override
    public R upd(int uid) {
        return null;
    }
}
